import request from "./request"

// 获取视频
export function list(data){
    return request({
        url: '/echo/video/list',
        method: 'post',
        data
    })
}

// 查看视频详情
export function watchVideo(videoId){
    return request({
        url:'/echo/video/info/'+videoId,
        method:'get'
    })
}

// 点赞视频
export function likeVideo(videoId){
    return request({
        url:'/echo/video/like/'+ videoId,
        method:'get',
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 判断是否点赞过视频
export function isVideoLike(videoId){
    return request({
        url:'/echo/video/isLike/'+ videoId,
        method:'get',
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 获取关注视频
export function getFollowingVideos(data){
    return request({
        url:'/echo/video/following/list',
        method:'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 获取点赞视频
export function getLikeVideos(data){
    return request({
        url:'/echo/video/like/list',
        method:'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 视频上传
export function uploadVideo(data){
    return request({
        url:'/echo/video/upload',
        method:'post',
        data,
        headers: {
            "Content-Type": "multipart/form-data",
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

// 合并提交
export function mergeVideoInfo(data){
    return request({
        url:'/echo/video/post',
        method:'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}

export function deleteVideoById(data){
    return request({
        url:'/echo/video/delete',
        method:'post',
        data,
        headers: {
            "Authorization":localStorage.getItem("Authorization")
        }
    })
}